package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.common.result.Result;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @ClassName DepartmentController
 * @Description: 类描述
 * @Author: admin
 * @CreateDate: 2024/6/11 21:29
 * @UpdateUser: 更新人
 * @UpdateDate: 2024/6/11 21:29
 * @UpdateRemark: 更新的信息
 * @Version: 1.0
 */

@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin //解决跨域问题
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "获取科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable("hoscode") String hoscode) {
        List<DepartmentVo> deptList=departmentService.getDeptTree(hoscode);
        return Result.ok(deptList);
    }
}
